/*
 * @Author: your name
 * @Date: 2021-07-08 21:52:23
 * @LastEditTime: 2021-07-12 19:57:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \day1\vue_shop\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css'
import 'assets/fonts/iconfont.css'
import './plugins/element.js'
import 'assets/css/global.less'
axios.defaults.baseURL="https://test.qhhz.xyz:8888/api/private/v1/"
//axios.defaults.baseURL="http://127.0.0.1:8888/api/private/v1/"
//通过axios请求拦截添加token,保证拥有获取数据的权限
// axios请求拦截
axios.interceptors.request.use(config => {
  // 为请求头对象，添加 Token 验证的 Authorization 字段
  config.headers.Authorization = window.sessionStorage.getItem('token')
  //console.log(config)
  return config
  })
Vue.prototype.$http=axios
Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
